//
//  MCSecurityCenterTableViewCell.m
//  TLYL
//
//  Created by MC on 2017/7/11.
//  Copyright © 2017年 TLYL01. All rights reserved.
//

#import "MCSecurityCenterTableViewCell.h"

@interface MCSecurityCenterTableViewCell ()
@property (nonatomic,strong)UIImageView * imgV_logo;
@property (nonatomic,strong)UILabel *lab_title;
@property (nonatomic,strong)UIView  *view_line;
@property (nonatomic,strong)UILabel * lab_tip;
/*
 * 箭头
 */
@property (nonatomic,strong)UIImageView * imgV_arrow;
@end

@implementation MCSecurityCenterTableViewCell
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self){
        [self initView];
    }
    return self;
}

- (void)initView{
    
    self.backgroundColor=[UIColor whiteColor];
    
    
    _imgV_logo=[[UIImageView alloc]init];
    [self addSubview:_imgV_logo];
    _imgV_logo.backgroundColor=[UIColor cyanColor];
    
    [_imgV_logo mas_makeConstraints:^(MASConstraintMaker *make) {

        make.width.mas_equalTo(30);
        make.height.mas_equalTo(30);
        make.centerY.equalTo(self.mas_centerY);
        make.left.equalTo(self.mas_left).offset(20);
        
    }];
    
    _lab_title =[[UILabel alloc]init];
    _lab_title.textColor=[UIColor grayColor];
    _lab_title.font=[UIFont systemFontOfSize:15];
    _lab_title.text =@"加载中";
    _lab_title.textAlignment=NSTextAlignmentLeft;
    [self  addSubview:_lab_title];
    [_lab_title mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.mas_top).offset(0);
        make.centerY.equalTo(self.mas_centerY);
        make.left.equalTo(_imgV_logo.mas_right).offset(10);
    }];
    
    _view_line=[[UIView alloc]init];
    [self addSubview:_view_line];
    _view_line.backgroundColor=RGB(200, 200, 200);
    [_view_line mas_makeConstraints:^(MASConstraintMaker *make) {
        make.bottom.equalTo(self.mas_bottom).offset(0);
        make.left.equalTo(self.mas_left).offset(10);
        make.right.equalTo(self.mas_right).offset(-10);
        make.height.mas_equalTo(1);
    }];
    
    /*
     * 箭头
     */
    _imgV_arrow=[[UIImageView alloc]init];
    [self addSubview:_imgV_arrow];
    _imgV_arrow.image=[UIImage imageNamed:@"MC_Arrow_test"];
    /*
     * 箭头
     */
    [_imgV_arrow mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(self.mas_centerY);
        make.right.equalTo(self.mas_right).offset(-10);
        make.height.mas_equalTo(20);
        make.width.mas_equalTo(20);
    }];
    
    _lab_tip=[[UILabel alloc]init];
    [self addSubview:_lab_tip];
    _lab_tip.textColor=[UIColor grayColor];
    _lab_tip.font=[UIFont systemFontOfSize:15];
    _lab_tip.text =@"";
    _lab_tip.textAlignment=NSTextAlignmentLeft;
    [_lab_tip mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.mas_top).offset(0);
        make.centerY.equalTo(self.mas_centerY);
        make.right.equalTo(_imgV_arrow.mas_left).offset(0);
    }];
    
    
}


-(void)setDataSource:(id)dataSource{
    _dataSource=dataSource;
    _lab_title.text=dataSource;

}
+(CGFloat)computeHeight:(id)info{
    return 50;
}
- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
